#pragma once

#include "Instruction.h"
#include "Value.h"
#include <string>
#include "LocalVariable.h"
#include "GlobalVariable.h"
#include "Function.h"
class StoreInstruction : public Instruction {
public:
    // 参数顺序：ptr, value
    StoreInstruction(Function * func, Value * ptr, Value * value);

    Value * getValue() const
    {
        return value_;
    }
    Value * getPtr() const
    {
        return ptr_;
    }

    // 转为字符串
    void toString(std::string & str) override;

private:
    Value * value_; // 要存储的值
    Value * ptr_;   // 存储目标地址
};